package service;

import org.apache.catalina.Manager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;

@Service
public class ManagerService {
    private ManagerDao dao;
    @Autowired
    public void setManagerDao(ManagerDao dao){
        this.dao=dao;
    }
    public boolean deleteManager(int ano){
        return dao.deleteManager(ano)>0;
    }
    public ArrayList<model.Manager> getManager(int ano){
        return dao.findManagerByAno(ano);
    }
    public ArrayList<model.Manager> getAllManagers(){
        return dao.getAllManagers();
    }
    public boolean editManager(model.Manager manager){
        return dao.editManager(manager)>0;
    }
    public boolean addManager(model.Manager manager){
        return  dao.addManager(manager)>0;
    }
}
